# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Joakim Hernberg <jhernberg at alchemy dot lu>

pkgname=rt-tests
pkgver=2.6
pkgrel=1
pkgdesc="A collection of latency testing tools for the linux(-rt) kernel"
arch=(loong64 x86_64)
url="https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/"
license=(GPL-2.0-or-later)
groups=(realtime)
depends=(glibc)
makedepends=(
  numactl
  python
)
optdepends=(
  'bash: for determine_maximum_mpps.sh'
  'numactl: for cyclictest, oslat and signaltest'
  'python: for get_cyclictest_snapshot and hwlatdetect'
)
source=($url/snapshot/$pkgname-$pkgver.tar.gz)
sha512sums=('28392b75cf2c9a252c192edb8102a5a371f34daf6d5803a6095fc10747c9401a77c674d6aefac24d8c7e3ca503ff1bb43518dc0292053df40af750da580539bb')
b2sums=('51bc726a8e3ce281f965f996322144a0079791aa9585728f55056c4c88dcbfa19fbc98aaa973b71b76e35c6a96cea301b09170eab9f8a126ebdd6e9070b5668f')

build() {
  export PYLIB=$(python -c 'import distutils.sysconfig;  print(distutils.sysconfig.get_python_lib())')
  make -C $pkgname-$pkgver
}

package() {
  make prefix=/usr DESTDIR="$pkgdir" install -C $pkgname-$pkgver
  install -vDm 644 $pkgname-$pkgver/{MAINTAINERS,README.markdown} -t "$pkgdir/usr/share/doc/$pkgname/"
}
